<html class="x-admin-sm" lang="ch">
<head>
	<meta charset="UTF-8">
	<title>网点管理</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<link rel="stylesheet" href="css/font.css">
	<link rel="stylesheet" href="css/xadmin.css">
	<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
	<script type="text/javascript" src="lib/layui/layui.js" charset="utf-8"></script>
	<script type="text/javascript" src="js/xadmin.js"></script>
	<script type="text/javascript" src="js/cookie.js"></script>
	<script type="text/javascript" src="js/address.js"></script>
</head>
<script>
    $(function(){
        $("#submit").click(function () {
            var str=address+"transNode/list";
            var property=$("#select").val();
            var inputValue=$("#input").val();
            $.ajax({
                url:str,
                type:"post",
                dataType:'JSON',
                data:"{\"" + property + "\":" + inputValue + "}",
                contentType : "application/json; charset=utf-8",
                success:function(data){
                    if(data.code.code === 0) {
                        var tableData;
                        var list=data.transNodeList;
                        $("#numspan").text("显示数据：" + (list.length).toString() + "条");
                        for (var i = 0; i < list.length; i++) {
                            var str = "<td class='td-manage'>" +
                                '<a title="编辑"  href="javascript:;"  onclick="x_admin_show( \'编辑\',\'network-edit.html?Data=' + list[i].id + '\',600,400)">' +
                                "<i class=\"layui-icon\">&#xe642;</i>" +
                                "</a>" +
                                '<a title="删除" href="javascript:;" onclick="transNode_del(this,' + list[i].id + ')">' +
                                "<i class='layui-icon'>&#xe640;</i> " +
                                "</a> " +
                                '<a title="查看" href="javascript:;"   onclick="x_admin_show(\'查看位置\',\'network-query.html?Data=' + list[i].id + '\',735,560)">' +
                                "<i class='layui-icon'>&#xe7ae;</i> " +
                                "</a> " +
                                "</td>";

                            tableData += "<tr> " +
                                "<td align='center'>" + list[i].id + "</td> " +
                                "<td align='center'>" + list[i].nodeName + "</td> " +
                                "<td align='center'>" + list[i].nodeType + "</td>" +
                                "<td align='center'>" + list[i].regionCode + "</td>" +
                                "<td align='center'>" + list[i].telCode + " </td>" +
                                "<td align='center'>" + list[i].x + "</td>" +
                                "<td align='center'>" + list[i].y + "</td>" + str +
                                "</tr>";
                        }
                        $("#firsttbody").html(tableData);
                    }else{
                        alert(data.code.message);
					}
                },
                error:function(){
                    alert("error");
                }
            });
        });
    });
</script>

<body>
	<div class="x-nav">
		  <span class="layui-breadcrumb">
			  <a href="">网点列表</a>
		  </span>
		<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
			<i class="layui-icon" style="line-height:30px">刷新</i>
		</a>
	</div>
	<div class="x-body">
		<div class="layui-row">

			<form class="layui-form layui-col-md12 x-so" method="#">
				<div class="layui-inline" style="margin-left: 430px">
					<div class="layui-inline">
						<select id="select">
							<option value="id">ID</option>
							<option value="nodeName">节点名称</option>
							<option value="nodeType">节点类型</option>
							<option value="regionCode">地区编码</option>
							<option value="telCode">电话号码</option>
						</select>
					</div>
					<input id="input" class="layui-input" type="text" name="customername" placeholder="请输入查询方式" autocomplete="off" value="">
					<button class="layui-btn" id="submit" type="button"><i class="layui-icon">&#xe615;</i></button>
				</div>
			</form>

		</div>

		<xblock>
			<button class="layui-btn" onclick="x_admin_show('添加网点信息','./network-add.html',480,460)"><i class="layui-icon"></i>添加</button>
			<span class="x-right" id="numspan" style="line-height:40px" type="text">显示数据：0条</span>
		</xblock>

		<table class="layui-table x-admin">
			<thead>
			<tr>
				<th>ID</th>
				<th>节点名称</th>
				<th>节点类型</th>
				<th>地区编码</th>
				<th>电话号码</th>
				<th>经度</th>
				<th>纬度</th>
			</tr>
			</thead>

			<tbody id="firsttbody"></tbody>

		</table>

	</div>
</body>
</html>